<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业示例</title>
</head>
<body>
    <p>阳光明媚</p>
    <input type="text" name="content"/>
    <button id="btn">点我干活</button>
</body>
<script>
    document.getElementById("btn").onclick = function () {
        let content = document.getElementsByName("content")[0].value;
        document.getElementsByTagName("p")[0].innerText = content;
    }
</script>
</html>